/*
 * @lc app=leetcode.cn id=506 lang=csharp
 *
 * [506] 相对名次
 */

// @lc code=start
public class Solution {
    public string[] FindRelativeRanks(int[] score) {
        string[] ans = new string[score.Length];
        int[] rank = new int[score.Length];
        for (int i = 0; i < score.Length; i++)
        {
            rank[i] = i;
        }
        Array.Sort(rank, (a, b) => score[b] - score[a]);
        for (int i = 0; i < score.Length; i++)
        {
            if (i == 0)
            {
                ans[rank[i]] = "Gold Medal";
            }
            else if (i == 1)
            {
                ans[rank[i]] = "Silver Medal";
            }
            else if (i == 2)
            {
                ans[rank[i]] = "Bronze Medal";
            }
            else
            {
                ans[rank[i]] = (i + 1).ToString();
            }
        }
        return ans;
    }
}
// @lc code=end

